<extend name="template/base_index" />


<block name="area_header">

    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
    <script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/jquery.validate.min.js"></script>
    <script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/localization/messages_zh.min.js"></script>

    <script type="text/javascript" charset="utf-8" src="__UPLOAD__/ueditor/1.4.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__UPLOAD__/ueditor/1.4.3/ueditor.all.min.js"> </script>
    <link type="text/css" rel="stylesheet" href="__CDN__/comp/wxuploader.css?v=__APP_VERSION__" />
    <link type="text/css" rel="stylesheet" href="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <script src="__JS__/city-picker.data.js"></script>
    <script src="__JS__/city-picker.js"></script>
    <link href="__CSS__/city-picker.css" rel="stylesheet" type="text/css" />
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}

            <!-- 带验证 form -->
            <form class="form-horizontal well validateForm" action="{:U('Admin/Enterprise/add_job')}" method="post">
                <fieldset>
                    <legend>
                    </legend>
                    <div class="form-group">
                        <label for="inputtitle" class="col-md-2 col-lg-2 control-label">招聘标题</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="required form-control input-short" name="title" id="inputtitle" placeholder="{:L('PLACEHOLDER_TITLE')}">
                            <div class="help-block">(请输入招聘岗位)</div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputtitle" class="col-md-2 col-lg-2 control-label">公司LOGO</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="hidden" name="main_img" id="main_img" value="{$vo.main_img}" />

                            <!-- 图片选择DOM结构 -->
                            <div class="wxuploaderimg clearfix" data-maxitems="1">
                                <div class="img-preview clearfix" >

                                </div>
                                <div class="add">
                                    <i class="fa fa-plus"></i>
                                </div>
                            </div>
                            <!-- 图片选择DOM结构 -->

                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputtitle" class="col-md-2 col-lg-2 control-label">工作地点</label>
                        <div class="col-md-10 col-lg-10">
                            <input id="city-picker3" class="form-control input-short" readonly type="text" name="address" value="浙江省/杭州市/江干区" data-toggle="city-picker">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputtitle" class="col-md-2 col-lg-2 control-label">招聘内容</label>
                        <div class="col-md-10 col-lg-10">
                            <script id="ueditor" name="text" type="text/plain" style="height: 480px;" ></script>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
                        <div class="col-lg-10 col-md-10">
                            <a  onclick="submit_post()" class="btn btn-primary"  ><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
                            <a class="btn btn-default" href="{:U('Admin/Enterprise/publish_job')}"><i class="fa fa-reply"></i>返回</a>
                        </div>
                    </div>
                </fieldset>
            </form>
            <!-- form -->
            <include file="template/wxpicture" />
        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
    <!--提示模态弹窗-->
    <div class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">提示</h4>
                </div>
                <div class="modal-body">
                    <p>表单信息不完整</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</block>

<block name="area_footer">

    <script>
        var ue = UE.getEditor('ueditor',{
            toolbars:[
                ['fullscreen', 'source', 'undo', 'redo', 'bold','italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', '|','lineheight'
                    , 'fontsize','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', 'insertimage','emotion','link', 'unlink', 'anchor', '|','map','print', 'preview',  'drafts','forecolor','backcolor'
                ]
            ]});
    </script>
    <script type="text/javascript">
        /*提交表单验证*/
        function submit_post(){
            $("#main_img").val($(".wxuploaderimg img").attr("data-imageid"));
            if($("[name='title']").val() == ''|| $("[name='text']").val() == ''||$("[name='address']").val() == ''){
                $('.modal').modal('show');
            }else{
                $('.validateForm').submit();
            }
        }


        $(function(){
            wxuploadimg.init({cont:".wxuploaderimg"});

            $('#starttime').datetimepicker({
                lang: 'ch'
            });
            $('#endtime').datetimepicker({
                lang: 'ch'
            });
        })
    </script>
</block>